/*
 * @Author: pengtianrui 2276608413@qq.com
 * @Date: 2024-07-19 14:42:56
 * @LastEditors: Wang Shuo wangshuo@sgsimulation.com
 * @LastEditTime: 2024-08-30 10:31:41
 * @FilePath: \SGFEM\DataStructure\FEM\Constraint\include\RBE2Data.h
 * @Description: RBE2 单元数据
 * RBE2
 */

#pragma once

#include <vector>

#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Element/ElementBase.h"
#include "DataStructure/Input/Solver/DOFDirections.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
struct DECLSPEC RBE2Data : public ElementBase
{
    SG::DataStructure::Common::Id              m_masterNode     = 0;    ///< 主节点编号
    SG::DataStructure::Common::I64             m_slaveDOFs      = 0;    ///< 从自由度
    SG::DataStructure::Common::Real            m_alpha          = 0.0;  ///< 热膨胀系数
    SG::DataStructure::Common::Real            m_refTemperature = 0.0;  ///< 参考温度
    SG::DataStructure::Common::Id              m_domainId       = 0;
    std::vector<SG::DataStructure::Common::Id> m_slaveNodes;
    /**
     * @brief 获取从属自由度集合
     *
     * 返回从属自由度集合的实例。
     *
     * @return 从属自由度集合的实例
     */
    SG::DataStructure::FEM::DofSet GetSlaveDofs () const;
    void                           SetSlaveDOFs (const SG::DataStructure::FEM::DofSet& dofs);
};

/// @brief 判断两个RBE2Data是否相等
/// @param lhs
/// @param rhs
/// @return
DECLSPEC bool operator== (const RBE2Data& lhs, const RBE2Data& rhs);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE